package com.sumer.function;

import java.util.function.Predicate;

/**
 * 返回boolean
 * Predicate接口 测试
 */
public class PredicateTest {

    public static void main(String[] args) {
        Predicate<String> predicate1 = new Predicate<String>() {
            @Override
            public boolean test(String o) {
                return false;
            }
        };

        // 通过lambda 简化
        Predicate<String> predicate2 = o -> true;

        System.out.println(predicate1.test("999"));
        System.out.println(predicate2.test("999"));
    }
}
